#ifndef USVGICONENGINESIMPLE_H
#define USVGICONENGINESIMPLE_H

#include<QIconEngine>
#include<QWidget>
#include<QSharedData>
#include<QString>
#include<QSharedDataPointer>
#include<QString>
#include<QSvgRenderer>

//class USvgIconEngineSimplePrivate;

class USvgIconEngineSimple : public QIconEngine
{
private:
    QSvgRenderer m_renderer;//svg解析渲染器
    QString m_svgFile;//当前传入的svg图片，存储它的路径即可
public:
    USvgIconEngineSimple();
    USvgIconEngineSimple(const USvgIconEngineSimple& other) = delete;
    ~USvgIconEngineSimple();
public:
    void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) override;
    QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) override;
    QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) override;

    void addPixmap(const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state) override;
    void addFile(const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state) override;

    QString key() const override;
    QIconEngine *clone() const override;
    bool read(QDataStream &in) override;
    bool write(QDataStream &out) const override;
    void virtual_hook(int id, void *data) override;
;
};





#endif
